<MDXHeader title="Aspect Ratio" description="Displays content within a desired ratio." />

<ComponentPreview name="aspect-ratio-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add aspect-ratio
```

</TabsContent>

<TabsContent value="manual">

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="aspect-ratio" />

</TabsContent>

</Tabs>

## Usage

```tsx
import { AspectRatio } from "~/components/ui/aspect-ratio"
```

```tsx
<AspectRatio ratio={16 / 9}>
  <img src="..." alt="..." class="size-full rounded-md object-cover" />
</AspectRatio>
```
